package com.yanyun.yczyy.api.controller;

import com.yanyun.yczyy.api.entities.*;
import com.yanyun.yczyy.api.repository.IPlatformApiRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class PlatformApiController {
    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/home/security")
    public HomeSecurityResponse homeSecurity() {
        return platformApiRepository.homeSecurity();
    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/home/park")
    public HomeParkResponse homePark() {
        return platformApiRepository.homePark();
    }

    @CrossOrigin(origins = {"*"})

    @GetMapping("/platform-api/home/energy")
    public List<HomeEnergy> homeEnergy() {
        return platformApiRepository.homeEnergy();
    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/home/ctp")
    public HomeCtpResponse homeCtp() {
        return platformApiRepository.homeCtp();
    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/home/location-security")
    public List<HomeLocationSecurityResponse> homeLocationSecurity() {
        return platformApiRepository.homeLocationSecurity();
    }

    @Autowired
    IPlatformApiRepository platformApiRepository;
}
